package com.study.feign;

import com.study.vo.CommonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * sentinel 对openFeign 实现熔断降级
 */
@Slf4j
@Component
public class SentinelFeignClientFallback implements SentinelFeignClient{
    @Override
    public CommonResponse<String> getResultByFeign(Integer code) {
        log.error("request supply error:[{}]",
                code);

        return new CommonResponse<>(
                -1,
                "sentinel feign fallback",
                "input code: " + code
        );


    }
}
